import os
import pymysql
pymysql.install_as_MySQLdb()
from sqlalchemy import create_engine
#basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
  SECRET_KEY = os.environ.get('SECRET_KEY') or '787565544'
  MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.qq.com')
  MAIL_PORT = int(os.environ.get('MAIL_PORT', '465'))
  MAIL_USE_SSL = os.environ.get('MAIL_USE_SSL', 'true').lower() in \
  ['true', 'on', '1']
  MAIL_USERNAME = os.environ.get('MAIL_USERNAME','2781363079@qq.com')
  MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD','zvdxezgfuygfdhbj' )
  FLASKY邮件前缀 = '[Flasky]博客'
  FLASKY邮件发送人 = 'Flasky 管理员 <2781363079@qq.com>'
  FLASKY管理员='2781363079@qq.com'

  SQLALCHEMY_TRACK_MODIFICATIONS = False

  FLASKY_POSTS_PER_PAGE = 10
  FLASKY_FOLLOWERS_PER_PAGE=5
  FLASKY_COMMENTS_PER_PAGE=5
  @staticmethod
  def init_app(app):
    pass
class DevelopmentConfig(Config):
  DEBUG = True
  SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
  'mysql://test:123456@localhost/testdb'
class TestingConfig(Config):
     TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
   'sqlite://'
class ProductionConfig(Config):
   SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
     'mysql://test:123456@localhost/testdb'
config = {
  'development': DevelopmentConfig,
  'testing': TestingConfig,
  'production': ProductionConfig,
  'default': DevelopmentConfig
}